﻿using DI;
using Library.Structuremap;
using StructureMap;
using StructureMap.Pipeline;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http;
using System.Web.Routing;

namespace Identity.API
{
    public class WebApiApplication : System.Web.HttpApplication
    {
        protected void Application_Start()
        {
            Bootstrapper.Init(new TransientLifecycle());
            GlobalConfiguration.Configure(WebApiConfig.Register);

            var structureMapResolver = new StructureMapDependencyResolver(Bootstrapper.Container);            
            GlobalConfiguration.Configuration.DependencyResolver = structureMapResolver;  
        }
    }
}
